package com.yang.shape;

import util.UnSupportedShapeException;

/**
 * Created by Administrator on 2017/5/12.
 */
public class Painter {

    public static Shape paint(String type) throws Exception{

        if(type.equals("circle")){
            return new Circle();
        }else if(type.equals("triangle")){
            return new Triangle();
        }else if(type.equals("rectangle")){
            return new Rectangle();
        }else{
            throw new UnSupportedShapeException("UnSupportedShapeException");
        }
    }
}
